/* 
 * File:   KeyboardInput.h
 * Author: faraj
 *
 * Created on October 8, 2009, 4:38 AM
 */

#ifndef _KEYBOARDINPUT_H
#define	_KEYBOARDINPUT_H
#include "Globaldata.h"

void* getInputFromKeyBoard(void* args)
{    
    while(true)
    {
        
        char ch;
        while((ch = getchar()) != '\n')
        {
            Pthread_mutex_lock(&mutex_val);
            val.push_back(ch);
            Pthread_mutex_unlock(&mutex_val);
        }
        
        Pthread_mutex_lock(&mutex_cap);
            doneCaptureKeys = true;
        Pthread_mutex_unlock(&mutex_cap);
        cout << "BunChi client > ";
    }
}

#endif	/* _KEYBOARDINPUT_H */

